﻿using CleanArchitecture.Infrastructure.Interfaces;

namespace CleanArchitecture.Infrastructure.Entities.Settings
{
    /// <summary>
    /// Customer settings
    /// </summary>
    public class AdminUserSettings : ISettings
    {
        //private EntityEnumConfig.PasswordFormat _format;
        /// <summary>
        /// Gets or sets a value indicating whether username will be validated using regex (when registering or changing on the 'My Account' page)
        /// </summary>
        public bool UserLoginnameValidationUseRegex { get; set; }

        /// <summary>
        /// Gets or sets a username validation rule
        /// e.g ^[a-zA-Z][a-zA-Z0-9]{3,9}$  
        /// means : usernames are not allowed to start with digits and min/max length restrictions
        /// </summary>
        public string UserLoginnameValidationRule { get; set; }

        /// <summary>
        /// Default password format for adminuser , hashed/encrypt
        /// </summary>
        public int DefaultPasswordFormat { get; set; }

        /// <summary>
        /// Gets or sets a customer password format (SHA1, MD5) when passwords are hashed (DO NOT edit in production environment)
        /// </summary>
        public string HashedPasswordFormat { get; set; }

        /// <summary>
        /// Gets or sets a minimum password length  默认为6最少位数密码
        /// </summary>
        public int? PasswordMinLength { get; set; }

        /// <summary>
        /// Gets or sets DavidLee 后台用户登录系统是否记录日志
        /// </summary>
        public bool LogAdminUserLoggedEvent { get; set; }

        /// <summary>
        /// Gets or sets a max password length  默认为15最多位数密码
        /// </summary>
        public int PasswordMaxLength { get; set; }

        /// <summary>
        /// Gets or sets a number of days for password expiration
        /// 当设置为0时，不校验密码过期
        /// </summary>
        public int PasswordLifetime { get; set; }

        /// <summary>
        /// Gets or sets maximum login failures to lockout account. Set 0 to disable this feature
        /// </summary>
        public int FailedPasswordAllowedAttempts { get; set; }

        /// <summary>
        /// Gets or sets a number of minutes to lockout users (for login failures).
        /// </summary>
        public int FailedPasswordLockoutMinutes { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether customers are allowed to upload avatars.
        /// </summary>
        public bool AllowAdminUsersToUploadAvatars { get; set; }

        /// <summary>
        /// Gets or sets a maximum avatar size (in bytes)
        /// </summary>
        public int AvatarMaximumSizeBytes { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether to display default user avatar.
        /// </summary>
        public bool DefaultAvatarEnabled { get; set; }

        /// <summary>
        /// DavidLee 2019/11/13 增加是否允许自主编辑用户信息 用户信息以键值对形式多条存储在AdminUserAttributes表中
        /// </summary>
        public bool AllowToEditAdminUserProfiles { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether deleted customer records should be prefixed suffixed with "-DELETED"
        /// </summary>
        public bool SuffixDeletedAdminUsers { get; set; }
    }
}